<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<link rel="icon" href="/logo.ico" type="image/x-icon"/>
		<link href="/css/bootstrap.min.css" rel="stylesheet">
        <link href="/css/style.css" rel="stylesheet">
		<script src="/js/ace.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/axios.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/edit.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/common.js" type="text/javascript" charset="utf-8"></script>
		<style>
			#editor
			{
				width:100%;
				height:calc(100vh - 140px);
				margin-bottom:25px;
			}
		</style>
	</head>
	<body>
        <iframe src="/head.html" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" style="height:75px;"></iframe><br>
        <iframe src="/main-control1.html" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" id="main-control1" style="height:40px;"></iframe>
		<div id="editor"></div>
		<script>
			var init_code="<init_code>";
			var show_init_code=decodeURIComponent(init_code);
			console.log(show_init_code)
			var editor=ace.edit("editor");
			editor.setValue(show_init_code);
			editor.setTheme("ace/theme/<theme>");
			editor.getSession().setMode("ace/mode/<mode>");
			editor.getSession().setTabSize(4);
			window.onkeydown=function(key)
			{
				if(key.code=="KeyS"&&key.ctrlKey==true)
				{
					save();
					return false;
				}
			}
			function change_event()
			{
				var bottom_div=document.getElementById("main-control2").contentWindow.document.getElementById("bottom_div");
				var left_span=document.getElementById("main-control2").contentWindow.document.getElementById("left-span");
				bottom_div.style.background="red";
				left_span.innerHTML="已编辑，未保存";
			}
			editor.getSession().on("change",change_event);
		</script>
        <iframe src="/main-control2.html" style="z-index:1000;position:fixed;bottom:0px;height: 25px;width:100%;" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" id="main-control2"></iframe>
        <script src="/js/bootstrap.bundle.min.js"></script>
	</body>
</html>